<template>
	<view>
		<custom-navigation-bar title="结果反馈"></custom-navigation-bar>
		<view style="width: 100%;height: 160rpx;float: left;height: 300rpx;"></view>
		<view class="result" v-if="data.status==0">
			 <view class="title_def"> 
				审核中
			 </view>
			 <view class="msg" >
				 <view style="width: 80%;float: left;margin-left: 15%;">
					 资料已提交，请耐心等待。
				 </view>
				 <view style="width: 80%;float: left;margin-left: 15%;margin-top: 15rpx;">
				 	 客服电话：{{data.city.phone}}
				 </view>
				 
			 </view>
		</view>
		
		<view class="result" v-if="data.status==2">
			 <view class="title_fail"> 
				审核失败
			 </view>
			 <view class="msg">
				 {{data.message}}
			 </view>
		</view>
		<view class="btn" v-if="data.status==2" @click="bianJi">
			返回编辑
		</view>
	</view>
</template>

<script setup> 
	import CustomNavigationBar from '@/components/CustomNavigationBar.vue';
	import http from '../../utils/http';
	const data=ref({
		status:0,
		city:{
			phone:''
		}
	});  
	import {
		onLoad,
	  	onPageScroll
	} from '@dcloudio/uni-app';
	const type=ref();
	onLoad((query) => {
		console.log(query.type)   
		type.value=query.type
		 http.request({
		 	url: "/X/application/result",
		 	method: "POST",
		 	data: {
		 		"pid": 0,
		 		type:query.type,
				userId:getApp().globalData.user.userId
		 	}
		 }).then((responseData) => { 
		 	 if(responseData.code==1){
		 		 data.value=responseData.data; 
		 	 }
		 }).catch((err) => {
		 	uni.showToast({
		 		icon: 'error',
		 		title: '请求失败'
		 	})
		 })
	})
	function bianJi(){
		if(type.value==1){
			uni.navigateTo({
				url: "/pages/application/form_shop?id="+data.value.id
			});
		}else if(type.value==2){
			uni.navigateTo({
				url: "/pages/application/form_butler?id="+data.value.id
			});
		}
		
	}
</script>

<style>
	.btn{
		width: 60%;float: left;margin-top: 60rpx;background: #2AE8DC;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 20rpx;margin-left: 20%;color: white;
	}
	Page{
		background-color: #F2F2F2;
		font-size: 30rpx;
	}
	.result{
		width: 70%;float: left;margin-left: 15%;background: white;border-radius: 30rpx;margin-top: 10rpx;
	}
	.title_def{
		width: 100%;text-align: center;float: left;line-height: 60rpx;margin-top: 40rpx;font-size: 35rpx;
	}
	.title_fail{
		width: 100%;text-align: center;float: left;line-height: 60rpx;margin-top: 40rpx;color: red;font-size: 35rpx;
	}
	.msg{
		width: 92%;text-align: left;float: left;margin-top: 30rpx;margin-left: 4%;margin-bottom: 30rpx;color: #707070;font-size: 27rpx;
	}
</style>